//#define __FORCE_TRACE__
//#define __FORCE_DEBUG__
//#define __FORCE_INFO__
#define THIS_FILE "MVTTraining\fn_addScore.sqf"
#include <core_macros.h>

TRACE_1("Start",_this);
TMFPROFILERSTART;

private ["_player","_score"];
DEFAULT_PARAM(_player,0,objNull);
DEFAULT_PARAM(_score,1,0);

if (_score != 0) then {
	if (isServer) then {
		if (!isnull (_player)) then {
			_player addScore(_score);
		};
	};
	if (!isDedicated) then {
		if (_score < 0) then {
			(format [localize "STR_CQB_LOSESCORE",name _player, abs(_score)]) call tmf_fnc_globalChat;
		};
	};
};

TRACE_1("End",score _player);
TMFPROFILERSTOP;
